package com.lhc.service.model;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
public class ItemModel {

    private Integer id;
    //商品名
    @NotBlank(message = "商品名不为空")
    private String title;
    //价格
    @NotNull(message = "商品价格不为空")
    @Min(value = 0,message = "商品价格大于0.00")
    private BigDecimal price;
    //库存
    @NotNull(message = "库存必填")
    private Integer stock;
    //描述
    @NotBlank(message = "描述不为空")
    private String description;
    //销量
    private Integer sales;
    //图片
    @NotBlank(message = "图片不为空")
    private String imgUrl;


}
